import request from '@/router/axios';

/**
 * 分页查询RMA登记信息
 */
export const getList = (current, size, params) => {
    return request({
        url: '/api/mes-product/rma/entry/page',
        method: 'get',
        params: {
            ...params,
            current,
            size
        }
    });
};

/**
 * RMA登记信息新增或修改
 */
export const addOrUpdate = (data) => {
    return request({
        url: '/api/mes-product/rma/entry/submit',
        method: 'post',
        data: data
    });
};

/**
 * 删除RMA登记信息
 */
export const remove = (ids) => {
    return request({
        url: '/api/mes-product/rma/entry/remove',
        method: 'post',
        params: {
            ids
        }
    });
};

/**
 * RMA登记信息详情
 */
export const getDetail = (rmaId) => {
    return request({
        url: '/api/mes-product/rma/entry/detail',
        method: 'get',
        params: {
            rmaId
        }
    });
};

/**
 * RMA登记进维修
 */
export const repairIn = (data) => {
    return request({
        url: '/api/mes-product/rma/entry/repair-in',
        method: 'post',
        data: data
    });
};

/**
 * 获取不良代码
 */
export const getFailure = (params) => {
    return request({
        url: '/api/mes-product/mro/dict/list',
        method: 'get',
        params: params
    });
};

export const getSequenceNumber = (data) => {
    return request({
        url: '/api/mes-product/product/check-is-in-sales-no',
        method: 'post',
        data: data
    });
};

export const delivery = (data) => {
    return request({
        url: '/api/mes-product/rma-delivery-record/delivery',
        method: 'post',
        data: data
    });
};
